package com.axdoc.doctor.exception;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;

import com.alibaba.fastjson.JSONObject;
import com.axdoc.common.exceptions.BizException;

public class BizExceptionMapperBk<T extends BizException> implements ExceptionMapper<T> {

    public Response toResponse(T e) {    
    	JSONObject json = new JSONObject();
        json.put("code", e.getCode());
        json.put("msg", e.getMsg());
        return Response.serverError().entity(json).build();
    }
}
